<template>
	<view>
		<view class="zhibo-detail">
			<live-player src="https://domain/pull_stream" autoplay @statechange="statechange" 
			@error="error" style="width: 300px; height: 225px;" />
			
			<navigator :url="'plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id='+data.id">进入直播间</navigator>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: {},
			}
		},
		onLoad() {
			if(option.id){
				this.get_data(option.id)
			}
		},
		methods: {
			get_data(id){
				let that=this
				this.$model.get("user/common/getPlaybacks?id="+id).then(res=>{
					if(res.code==200){
						that.data=res.data
					}
				})
			},
			statechange(e) {
				console.log('live-player code:', e.detail.code);
			},
			error(e) {
				console.error('live-player error:', e.detail.errMsg);
			}

		}
	}
</script>

<style>

</style>
